{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            {switch name="$Request.param.cid"}
                {case value="1"}
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>公司名称：</label>
                <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="公司名称" name="bname" value="{$vo.bname ?? ''}"  datatype="*" nullmsg="请填写公司名称">
                 </div>
                {/case}
                {case value="2"}
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>名称：</label>
                <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="名称" name="bname" value="{$vo.bname ?? ''}"  datatype="*" nullmsg="请填写公司名称">
                </div>
                {/case}
                {case value="4"}
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>公司名称：</label>
                <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="公司名称" name="bname" value="{$vo.bname ?? ''}"  datatype="*" nullmsg="请填写公司名称">
                </div>
                {/case}
                {default /}
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>公司名称：</label>
                <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="公司名称" name="bname" value="{$vo.bname ?? ''}"  datatype="*" nullmsg="请填写公司名称">
            </div>
            {/switch}
            
            
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>所属专业分类：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <span class="select-box">
                    <select class="select" size="1" name="c_id">
                        {volist name='class' id='val'}
                            {if condition="isset($vo.cid) && $vo.cid eq $val.id"}
                                <option value="{$val.id}" selected="">{$val.name}</option>
                            {else/}
                                <option value="{$val.id}">{$val.name}</option>
                            {/if}
                            {/volist}
                    </select>
                </span>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>图片：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" id="upload" name="img" value="{$vo.img ?? ''}" placeholder="请点击后面的上传按钮" datatype="*" nullmsg="请上传图片" style="width: 70%">
                <button type="button" class="btn btn-primary radius" onclick="layer_open('文件上传','{:\\think\\Url::build(\'Upload/index\', [\'id\' => \'upload\',\'filedir\'=>\'company\'])}')">上传</button>
                <a onclick="$(this).attr('href', '/uploads/company/'+$('#upload').val())" type="button" class="btn btn-success radius" data-lightbox="preview">预览</a>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>详细：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!-- <input type="text" class="input-text" placeholder="详细" name="content" value="{$vo.content ?? ''}"  datatype="*" nullmsg="请填写详细"> -->
                <textarea class="textarea radius" placeholder="详细" name="content" id="" cols="30" rows="10" datatype="*" nullmsg="请填写内容">{$vo.content ?? ''}</textarea>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>评论：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="评论" name="comment" value="{$vo.comment ?? ''}"  datatype="*" nullmsg="请填写评论">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__LIB__/lightbox2/js/lightbox.min.js"></script>

<script>
    $(function () {


        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
